/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.posplus.losspreventiondataimporter.service;

import com.posplus.lossprevention.APDAOFactory;
import com.posplus.lossprevention.dao.CashiersDAO;
import com.posplus.lossprevention.mapping.Cashiers;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author scottw
 */
public class CashiersService {

    private CashiersDAO cashierDAO;
    
    public CashiersService(CashiersDAO cashierDAO){
        this.cashierDAO = cashierDAO;
    }
    
    public CashiersService(APDAOFactory lpFactory) {
        this.cashierDAO = lpFactory.getCashiersDAO();
    }

    public void bulkInsert(List<Cashiers> cashiers) {
        cashierDAO.bulkInsert(cashiers);
    }

    public void save(Cashiers cashier) {
        cashierDAO.makePersistent(cashier);
    }

    public void saveAll(List<Cashiers> mappedCashiers) {
	Iterator<Cashiers> iter = mappedCashiers.iterator();
	while (iter.hasNext()) {
	    cashierDAO.save(iter.next());
	    
	}
    }
    
}
